﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModelLayer
{
    public class Room
    {
        private int id;
        private string name;
        private int seats;
        private Cinema cinema;

        public Room(string name, int seats, Cinema cinema)
        {
            this.name = name;
            this.seats = seats;
            this.cinema = cinema;
        }

        public Room(int id, string name, int seats, Cinema cinema)
        {
            this.id = id;
            this.name = name;
            this.seats = seats;
            this.cinema = cinema;
        }

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public int Seats
        {
            get { return seats; }
            set { seats = value; }
        }

        public Cinema Cinema
        {
            get { return cinema; }
            set { cinema = value; }
        }

        // override object.Equals
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            Room r = (Room) obj;
            

            return
                this.Cinema.Equals(r.Cinema) &&
                this.Name.Equals(r.Name) &&
                this.Seats.Equals(r.Seats);

        }

        public override string ToString()
        {
            return this.name;
        }
    }
}
